package com.ihr360.payroll.model.dto.salary.payslip;

import com.ihr360.payroll.model.dto.salary.task.period.StaffPayPeriodTermSalary;
import com.ihr360.shared.entitywithlistener.NumberIdWithTimeAndCompanyId;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import java.util.Date;

@Getter
@Setter
@Entity
public class StaffPayslip extends NumberIdWithTimeAndCompanyId<Long> {

    private static final long serialVersionUID = -5274507597058012570L;
    @ManyToOne
    @JoinColumn(name="payslipResult_id")
    private PayslipResult payslipResult;

    @Column(columnDefinition = "bit(1) default 0")
    private int status = PayslipResult.PayslipStatus.DEFAULT;

    @OneToOne
    private StaffPayPeriodTermSalary staffSalary;

    private Date publishedAt;
}
